﻿using BCEntity.TMS.RedPacket.RedPacketReceive;
using System.Collections.Generic;
using System.Threading.Tasks;

namespace BCData.TMS.RedPacket.RedPacketReceive
{
    public interface IRedPacketReceiveData
    {
        /// <summary>
        /// 添加
        /// </summary>
        /// <param name="entity"></param>
        /// <returns></returns>
        Task<RedPacketReceiveEntity> InsertAsync(RedPacketReceiveEntity entity);
        /// <summary>
        /// 修改
        /// </summary>
        /// <param name="entity"></param>
        /// <returns></returns>
        Task<RedPacketReceiveEntity> UpdateAsync(RedPacketReceiveEntity entity);
        /// <summary>
        /// 获取列表
        /// </summary>
        /// <param name="redPacketTypeId">红包类型Id</param>
        /// <param name="redPacketId">红包Id</param>
        /// <returns></returns>
        Task<IEnumerable<RedPacketReceiveEntity>> GetList(long? redPacketTypeId, long? redPacketId, long? userId);
        /// <summary>
        /// 获取分页
        /// </summary>
        /// <param name="userId">用户id</param>
        /// <param name="redPacketId">红包id</param>
        /// <param name="pageIndex"></param>
        /// <param name="pageSize"></param>
        /// <returns></returns>
        Task<(IEnumerable<RedPacketReceiveEntity>,int)> Query(long agentRecordId, long? redPacketId, long? userId,
            int pageIndex,int pageSize);
        /// <summary>
        /// 获取红包票号
        /// </summary>
        /// <returns></returns>
        Task<RedPacketReceiveEntity> GetRedPacketNumber();

        /// <summary>
        /// 获取红包票号
        /// </summary>
        /// <param name="redPacketId">红包id</param>
        /// <param name="userId">用户id</param>
        /// <returns></returns>
        Task<RedPacketReceiveEntity> GetEntityByRedPacketId(long redPacketId,long userId);
    }
}
